package telas.venda;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.ImageIcon;
import java.awt.Font;
import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import java.awt.SystemColor;

public class TelaVendaAuxiliarCliente extends JFrame {

	private JPanel contentPane;
	private JTextField tfNomeCliente;
	private JTextField tfCpfCliente;
	private JTable table;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					TelaVendaAuxiliarCliente frame = new TelaVendaAuxiliarCliente();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public TelaVendaAuxiliarCliente() {
		super("Selecionar Cliente");
		setResizable(false);
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setBounds(100, 100, 800, 600);
		setVisible(true);
		contentPane = new JPanel();
		contentPane.setBackground(SystemColor.controlHighlight);
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JLabel label = new JLabel(" ");
		label.setIcon(new ImageIcon(TelaVendaAuxiliarCliente.class.getResource("/telas/sistema/figuras/LogoComFundo2.png")));
		label.setBounds(0, 0, 794, 128);
		contentPane.add(label);
		
		JLabel lblPesquisarCliente = new JLabel("Pesquisar Cliente");
		lblPesquisarCliente.setFont(new Font("Tahoma", Font.BOLD, 18));
		lblPesquisarCliente.setBounds(10, 139, 352, 19);
		contentPane.add(lblPesquisarCliente);
		
		JLabel lblNome = new JLabel("Nome");
		lblNome.setFont(new Font("Tahoma", Font.PLAIN, 12));
		lblNome.setBounds(10, 170, 51, 15);
		contentPane.add(lblNome);
		
		tfNomeCliente = new JTextField();
		tfNomeCliente.setColumns(10);
		tfNomeCliente.setBounds(10, 186, 555, 20);
		contentPane.add(tfNomeCliente);
		
		JLabel lblCpf = new JLabel("CPF");
		lblCpf.setFont(new Font("Tahoma", Font.PLAIN, 12));
		lblCpf.setBounds(575, 170, 184, 15);
		contentPane.add(lblCpf);
		
		tfCpfCliente = new JTextField();
		tfCpfCliente.setColumns(10);
		tfCpfCliente.setBounds(575, 186, 207, 20);
		contentPane.add(tfCpfCliente);
		
		JButton btnPesquisarCliente = new JButton("Pesquisar");
		btnPesquisarCliente.setBounds(10, 216, 130, 23);
		contentPane.add(btnPesquisarCliente);
		
		JButton btnLimparPesquisa = new JButton("Limpar Pesquisa");
		btnLimparPesquisa.setBounds(150, 216, 130, 23);
		contentPane.add(btnLimparPesquisa);
		
		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setBounds(10, 250, 772, 273);
		contentPane.add(scrollPane);
		
		table = new JTable();
		table.setBackground(SystemColor.info);
		table.setModel(new DefaultTableModel(
			new Object[][] {
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
			},
			new String[] {
				"Nome", "CPF", "RG", "Cidade", "Tel. Celular", "Tel. Fixo"
			}
		));
		table.getColumnModel().getColumn(0).setPreferredWidth(235);
		table.getColumnModel().getColumn(1).setPreferredWidth(104);
		scrollPane.setViewportView(table);
		
		JButton btnAnexarAoPedido = new JButton("Anexar ao Pedido");
		btnAnexarAoPedido.setIcon(new ImageIcon(TelaVendaAuxiliarCliente.class.getResource("/telas/sistema/figuras/attach.png")));
		btnAnexarAoPedido.setBounds(627, 534, 155, 23);
		contentPane.add(btnAnexarAoPedido);
	}
}
